import sklearn as sk
from sklearn.datasets import load_iris
from sklearn.preprocessing import StandardScaler
import torch as pt
from torch.utils.data import DataLoader, TensorDataset

pt.manual_seed(777)

x, y = load_iris(return_X_y=True)
scaler = StandardScaler()
x = scaler.fit_transform(x)
print('x', x.shape)
print('y', y.shape)

x = pt.from_numpy(x)
y = pt.from_numpy(y)

ds = TensorDataset(x, y)
dl = DataLoader(ds, batch_size=64, shuffle=True)

for i, (bx, by) in enumerate(dl):
    if 0 == i:
        print(bx[:5])
        print(by)
    print(bx.shape)
    print(by.shape)
